unit dmda_Process;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, dmModule, FR_DSet, FR_DBSet, DB, ADODB;

type
  Tdtmda_Process = class(TdtmModule)
    adsMasterEditWriter: TStringField;
    adsMasterEditWriteTime: TDateTimeField;
    adsMasterEditModifier: TStringField;
    adsMasterEditModifyTime: TDateTimeField;
    adsMasterEditRemark: TStringField;
    adsMasterEditProcessID: TStringField;
    adsMasterEditProcessCode: TStringField;
    adsMasterEditProcessName: TStringField;
    adsMasterEditProcessEngName: TWideStringField;
    adsMasterEditHelperCode: TStringField;
    adsMasterEditHasProcess: TBooleanField;
    adsMasterEditHasSendOut: TBooleanField;
    adsMasterEditHasColor: TBooleanField;
    adsMasterEditHasUse: TBooleanField;
    adsMasterEditHasSysDefine: TBooleanField;
    adsMasterEditHasDefault: TBooleanField;
    adsMasterEditHasStop: TBooleanField;
    adsMasterEditStoper: TStringField;
    adsMasterEditStopDate: TDateTimeField;
    adsMasterEditStopMemo: TStringField;
    adsMasterEditHasCheck: TBooleanField;
    adsMasterEditChecker: TStringField;
    adsMasterEditCheckTime: TDateTimeField;
    adsMasterEditHasInPut: TBooleanField;
    adsMasterProcessID: TStringField;
    adsMasterProcessCode: TStringField;
    adsMasterProcessName: TStringField;
    adsMasterProcessEngName: TWideStringField;
    adsMasterHelperCode: TStringField;
    adsMasterHasProcess: TBooleanField;
    adsMasterHasSendOut: TBooleanField;
    adsMasterHasColor: TBooleanField;
    adsMasterHasUse: TBooleanField;
    adsMasterHasSysDefine: TBooleanField;
    adsMasterHasDefault: TBooleanField;
    adsMasterHasStop: TBooleanField;
    adsMasterStoper: TStringField;
    adsMasterStopDate: TDateTimeField;
    adsMasterStopMemo: TStringField;
    adsMasterHasCheck: TBooleanField;
    adsMasterChecker: TStringField;
    adsMasterCheckTime: TDateTimeField;
    adsMasterHasInPut: TBooleanField;
    adsMasterWriter: TStringField;
    adsMasterWriteTime: TDateTimeField;
    adsMasterModifier: TStringField;
    adsMasterModifyTime: TDateTimeField;
    adsMasterRemark: TStringField;
    adsProcessList: TADODataSet;
    procedure adsMasterEditProcessNameChange(Sender: TField);
  private
    { Private declarations }
  protected
    procedure ModuleInit; override;
    procedure OpenEditDataSet;override;
  public
    { Public declarations }
  end;

var
  dtmda_Process: Tdtmda_Process;

implementation

uses dmConnect, uSQL;

{$R *.dfm}

{ Tdtmcj_ProcessPrice }

procedure Tdtmda_Process.ModuleInit;
begin
  FUniqueTable := 'da_Process';
  inherited;

end;

procedure Tdtmda_Process.OpenEditDataSet;
begin
  FMasterEditTable := 'da_Process';
  FMasterKeyField := 'ProcessID';
  inherited;
end;

procedure Tdtmda_Process.adsMasterEditProcessNameChange(Sender: TField);
begin
  inherited;
  if (adsMasterEdit.State in [dsInsert, dsEdit]) and (Sender.AsString<>'') then
  begin
    adsMasterEdit.FieldByName('HelperCode').ReadOnly := False;
    adsMasterEdit.FieldByName('HelperCode').AsString :=
      GetHzPy(adsMasterEdit.FieldByName('ProcessName').AsString);
  end;
end;

end.
